import Vue from 'vue';
import VueRouter from 'vue-router';

import Login from'@/views/Login';
import Home from'@/views/Home';
import Welcome from'@/views/Welcome';

import Employee from '@/views/management/employee';
import Role from '@/views/management/Role';
import Permission from '@/views/management/Permission';
import Menu from '@/views/management/Menu';
import ProductInfo from '@/views/management/product/ProductInfo'
import ProductType from '@/views/management/product/ProductType'
import PurchaseOrder from '@/views/management/purchase/PurchaseOrder'
import PurchaseOrderCheck from '@/views/management/purchase/PurchaseOrderCheck'
import PurchaseOrderRecord from '@/views/management/purchase/PurchaseOrderRecord'

import Dynamic2 from '@/views/management/warehouse/Dynamic2'

import GatherApply from '@/views/management/warehouse/GatherApply'
import GatherApply1 from '@/views/management/warehouse/GatherApply1'
import GatherCheck from '@/views/management/warehouse/GatherCheck'
import GatherTransfer from '@/views/management/warehouse/GatherTransfer'

import PayApply from '@/views/management/warehouse/PayApply'
import PayApply1 from '@/views/management/warehouse/PayApply1'
import PayCheck from '@/views/management/warehouse/PayCheck'
import PayTransfer from '@/views/management/warehouse/PayTransfer'
import Tabs from '@/views/management/warehouse/Tabs'
import Tabs2 from '@/views/management/warehouse/Tabs2'

import SupplyOrder from '@/views/management/order/SupplyOrder'
import SupplyOrderRecord from '@/views/management/order/SupplyOrderRecord'
import FrontUser from "@/views/management/user/FrontUser.vue";
import MerchantReview from '@/views/management/user/MerchantReview.vue'
import SupplierReview from "@/views/management/user/SupplierReview.vue";

Vue.use(VueRouter);

const router =new VueRouter({
  routes: [
    // 重定向
    { path: '/', redirect: '/login' },
    // 登录组件
    { path: '/login', component: Login },
    // 1.后台主页组件
    {
      path: '/home',
      component: Home,
      redirect: "/welcome",
      children: [
        { path: '/welcome', component: Welcome },
        { path: '/employee', component: Employee },
        { path: '/role', component: Role },
        { path: '/permission', component: Permission },
        { path: '/menu', component: Menu },

        { path: '/productInfo' , component: ProductInfo},
        { path: '/productType' , component: ProductType},

        { path: '/purchaseOrder' , component: PurchaseOrder},
        { path: '/purchaseOrderCheck' , component: PurchaseOrderCheck},
        { path: '/purchaseOrderRecord' , component: PurchaseOrderRecord},

        { path: '/supplyOrder' , component: SupplyOrder},
        { path: '/supplyOrderRecord' , component: SupplyOrderRecord},

        { path: '/dynamic2' , component: Dynamic2},


        { path: '/gatherApply1' , component: GatherApply1},
        { path: '/gatherApply' , component: GatherApply},
        { path: '/gatherCheck' , component: GatherCheck},
        { path: '/gatherTransfer' , component: GatherTransfer},

        { path: '/tabs' , component: Tabs},
        { path: '/tabs2' , component: Tabs2},

        { path: '/payApply' , component: PayApply},
        { path: '/payApply1' , component: PayApply1},
        { path: '/payCheck' , component: PayCheck},
        { path: '/payTransfer' , component: PayTransfer},
        {path: '/front', component:FrontUser},
        {path: '/merchant', component:MerchantReview},
        {path: '/supplier', component:SupplierReview},

        // { path: '/purchaseOrderCheck' , component: PurchaseOrderCheck},
        // { path: '/purchaseOrderRecord' , component: PurchaseOrderRecord}
      ]
    }
  ]
})

export default router;